/**
 *  Copyright 2002-2009 the original author or authors.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package foo.bar.blog.core.security;

import org.jsecurity.authz.Permission;

import java.util.HashSet;
import java.util.Set;

/**
 * An enum indicating the possible roles that a {@link foo.bar.blog.core.domain.User} could have.
 *
 * ANONYMOUS
 *      mainPortal:viewRecentEntries:*
 *      mainPortal:viewWeblogDirectories:*
 *      user:register:*
 *      user:forgottenPassword:*
 *      blog:addBlogEntryComment:*
 *
 * REGISTERED USER
 *      mainPortal:viewRecentEntries:*
 *      mainPortal:viewWeblogDirectories:*
 *      user:register:*
 *      user:forgottenPassword:*
 *      user:addBlog:*
 *      profile:viewProfile:*
 *      profile:editProfile:*
 *      profile:changePassword:*
 *      blog:viewBlogs:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewBlogs:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editBlog:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editBlog:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewBlogMainPage:*
 *      blog:newBlogEntry:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:newBlogEntry:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewBlogEntries:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewBlogEntries:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editBlogEntry:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editBlogEntry:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewBlogEntryComments:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewBlogEntryComments:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:addBlogEntryComment:*
 *      blog:viewTags:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewTags:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editTag:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editTag:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewLinks:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewLinks:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editLink:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editLink:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewResources:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewResources:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editResource:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editResource:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *
 * MODERATOR
 *      mainPortal:viewRecentEntries:*
 *      mainPortal:viewWeblogDirectories:*
 *      user:register:*
 *      user:forgottenPassword:*
 *      user:addBlog:*
 *      profile:viewProfile:*
 *      profile:editProfile:*
 *      profile:changePassword:*
 *      blog:viewBlogs:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewBlogs:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editBlog:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editBlog:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:deleteBlog:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:deleteBlog:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewBlogMainPage:*
 *      blog:addBlogMembership:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:removeBlogMembership:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewBlogEntries:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewBlogEntries:.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:newBlogEntry:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:newBlogEntry:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editBlogEntry:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editBlogEntry:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:deleteBlogEntry:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:deleteBlogEntry:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewBlogEntryComments:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewBlogEntryComments:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:addBlogEntryComment:*
 *      blog:deleteBlogEntryComment:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:deleteBlogEntryComment:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewTags:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewTags:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editTag:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editTag:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:addTag:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:addTag:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:deleteTag:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:deleteTag:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewLinks:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewLinks:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editLink:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editLink:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:addLink:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_ID
 *      blog:addLink:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:deleteLink:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:deleteLink:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:viewResources:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:viewResources:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:editResource:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:editResource:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:addResource:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:addResource:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *      blog:deleteResource:CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS
 *      blog:deleteResource:CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS
 *
 *
 * ADMINISTRATOR
 *      mainPortal:viewRecentEntries:*
 *      mainPortal:viewWeblogDirectories:*
 *      user:addUser:*
 *      user:viewUser:*
 *      user:editUser:*
 *      user:removeUser:*
 *      user:register:*
 *      user:addBlog:*
 *      profile:viewProfile:*
 *      profile:editProfile:*
 *      profile:changePassword:*
 *      blog:viewBlogs:*
 *      blog:editBlog:*
 *      blog:deleteBlog:*
 *      blog:viewBlogMainPage:*
 *      blog:addBlogMembership:*
 *      blog:removeBlogMembership:*
 *      blog:viewBlogEntries:*
 *      blog:newBlogEntry:*
 *      blog:editBlogEntry:*
 *      blog:deleteBlogEntry:*
 *      blog:viewBlogEntryComments:*
 *      blog:addBlogEntryComment:*
 *      blog:deleteBlogEntryComment:*
 *      blog:viewTags:*
 *      blog:editTag:*
 *      blog:addTag:*
 *      blog:deleteTag:*
 *      blog:viewLinks:*
 *      blog:editLink:*
 *      blog:addLink:*
 *      blog:deleteLink:*
 *      blog:viewResources:*
 *      blog:editResource:*
 *      blog:addResource:*
 *      blog:deleteResource:*
 *
 * @author tmjee
 * @version $Date: 2009-06-06 13:26:52 +0000 (Sat, 06 Jun 2009) $ $Id$
 */
public enum RoleType {
    ANONYMOUS() {
        public Set<Permission> permission() {
            return new HashSet<Permission>() { {
                // mainPortal
                add(new ExtendedWildcardPermission2("mainPortal:viewRecentEntries:*"));
                add(new ExtendedWildcardPermission2("mainPortal:viewWeblogDirectories:*"));

                // user
                add(new ExtendedWildcardPermission2("user:register:*"));
                add(new ExtendedWildcardPermission2("user:forgottenPassword:*"));

                // blog
                add(new ExtendedWildcardPermission2("blog:viewBlogMainPage:*"));

                // blogEntryComment
                add(new ExtendedWildcardPermission2("blog:addBlogEntryComment:*"));

            }};
    }},
    REGISTERED_USER() {
        public Set<Permission> permission() {
            return new HashSet<Permission>() { {
                // mainPortal
                add(new ExtendedWildcardPermission2("mainPortal:viewRecentEntries:*"));
                add(new ExtendedWildcardPermission2("mainPortal:viewWeblogDirectories:*"));

                // user
                add(new ExtendedWildcardPermission2("user:register:*"));
                add(new ExtendedWildcardPermission2("user:forgottenPassword:*"));
                add(new ExtendedWildcardPermission2("user:addBlog:*"));

                // profile
                add(new ExtendedWildcardPermission2("profile:viewProfile:*"));
                add(new ExtendedWildcardPermission2("profile:editProfile:*"));
                add(new ExtendedWildcardPermission2("profile:changePassword:*"));

                // blog
                add(new ExtendedWildcardPermission2("blog:viewBlogs:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogs:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editBlog:"+ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editBlog:"+ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogMainPage:*"));

                // blogEntry
                add(new ExtendedWildcardPermission2("blog:newBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:newBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogEntries:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogEntries:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogEntryComments:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogEntryComments:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));

                // blogEntryComment
                add(new ExtendedWildcardPermission2("blog:addBlogEntryComment:*"));

                // tag
                add(new ExtendedWildcardPermission2("blog:viewTags:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewTags:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editTag:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editTag:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));

                // link
                add(new ExtendedWildcardPermission2("blog:viewLinks:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewLinks:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editLink:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editLink:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));

                // resource
                add(new ExtendedWildcardPermission2("blog:viewResources:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewResources:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editResource:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editResource:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));

            }};
    }},
    MODERATOR() {
        public Set<Permission> permission() {
            return new HashSet<Permission>() { {
                add(new ExtendedWildcardPermission2("mainPortal:viewRecentEntries:*"));
                add(new ExtendedWildcardPermission2("mainPortal:viewWeblogDirectories:*"));

                add(new ExtendedWildcardPermission2("user:register:*"));
                add(new ExtendedWildcardPermission2("user:forgottenPassword:*"));
                add(new ExtendedWildcardPermission2("user:addBlog:*"));

                add(new ExtendedWildcardPermission2("profile:viewProfile:*"));
                add(new ExtendedWildcardPermission2("profile:editProfile:*"));
                add(new ExtendedWildcardPermission2("profile:changePassword:*"));

                add(new ExtendedWildcardPermission2("blog:viewBlogs:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogs:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editBlog:"+ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editBlog:"+ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteBlog:"+ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteBlog:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogMainPage:*"));
                add(new ExtendedWildcardPermission2("blog:addBlogMembership:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:removeBlogMembership:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));

                add(new ExtendedWildcardPermission2("blog:viewBlogEntries:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogEntries:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:newBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:newBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteBlogEntry:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogEntryComments:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewBlogEntryComments:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));

                // blogEntryComment
                add(new ExtendedWildcardPermission2("blog:addBlogEntryComment:*"));
                add(new ExtendedWildcardPermission2("blog:deleteBlogEntryComment:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteBlogEntryComment:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));

                // tag
                add(new ExtendedWildcardPermission2("blog:viewTags:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewTags:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editTag:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editTag:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:addTag:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:addTag:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteTag:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteTag:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));

                // link
                add(new ExtendedWildcardPermission2("blog:viewLinks:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewLinks:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editLink:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editLink:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:addLink:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:addLink:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteLink:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteLink:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));

                // resource
                add(new ExtendedWildcardPermission2("blog:viewResources:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:viewResources:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editResource:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:editResource:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:addResource:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:addResource:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteResource:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_MEMBERSHIP_BLOG_IDS));
                add(new ExtendedWildcardPermission2("blog:deleteResource:"+ ExtendedWildcardPermission2.CURRENT_USER_BLOG_OWNERSHIP_BLOG_IDS));
            }};
    }},
    ADMINISTRATOR() {
        public Set<Permission> permission() {
            return new HashSet<Permission>() { {
                add(new ExtendedWildcardPermission("mainPortal:viewRecentEntries:*"));
                add(new ExtendedWildcardPermission("mainPortal:viewWeblogDirectories:*"));

                add(new ExtendedWildcardPermission("user:addUser:*"));
                add(new ExtendedWildcardPermission("user:viewUser:*"));
                add(new ExtendedWildcardPermission("user:editUser:*"));
                add(new ExtendedWildcardPermission("user:removeUser:*"));
                add(new ExtendedWildcardPermission("user:register:*"));
                add(new ExtendedWildcardPermission("user:addBlog:*"));

                add(new ExtendedWildcardPermission("profile:viewProfile:*"));
                add(new ExtendedWildcardPermission("profile:editProfile:*"));
                add(new ExtendedWildcardPermission("profile:changePassword:*"));

                add(new ExtendedWildcardPermission2("blog:viewBlogs:*"));
                add(new ExtendedWildcardPermission2("blog:editBlog:*"));
                add(new ExtendedWildcardPermission2("blog:deleteBlog:*"));
                add(new ExtendedWildcardPermission2("blog:viewBlogMainPage:*"));
                add(new ExtendedWildcardPermission2("blog:addBlogMembership:*"));
                add(new ExtendedWildcardPermission2("blog:removeBlogMembership:*"));

                add(new ExtendedWildcardPermission2("blog:viewBlogEntries:*"));
                add(new ExtendedWildcardPermission2("blog:newBlogEntry:*"));
                add(new ExtendedWildcardPermission2("blog:editBlogEntry:*"));
                add(new ExtendedWildcardPermission2("blog:deleteBlogEntry:*"));
                add(new ExtendedWildcardPermission2("blog:viewBlogEntryComments:*"));

                add(new ExtendedWildcardPermission2("blog:addBlogEntryComment:*"));
                add(new ExtendedWildcardPermission2("blog:deleteBlogEntryComment:*"));

                add(new ExtendedWildcardPermission2("blog:viewTags:*"));
                add(new ExtendedWildcardPermission2("blog:editTag:*"));
                add(new ExtendedWildcardPermission2("blog:addTag:*"));
                add(new ExtendedWildcardPermission2("blog:deleteTag:*"));

                add(new ExtendedWildcardPermission2("blog:viewLinks:*"));
                add(new ExtendedWildcardPermission2("blog:editLink:*"));
                add(new ExtendedWildcardPermission2("blog:addLink:*"));
                add(new ExtendedWildcardPermission2("blog:deleteLink:*"));

                add(new ExtendedWildcardPermission2("blog:viewResources:*"));
                add(new ExtendedWildcardPermission2("blog:editResource:*"));
                add(new ExtendedWildcardPermission2("blog:addResource:*"));
                add(new ExtendedWildcardPermission2("blog:deleteResource:*"));
            }};
    }};

    public abstract Set<Permission> permission();
    
}
